const routes = [
  {
    // passport
    path: '/passport',
    component: () => import('@/page/passport/Passport.vue'),
    children: [{
      // 登录
      path: 'login',
      component: () => import('@/page/passport/Login.vue')
    }, {
      // 注册
      path: 'register',
      component: () => import('@/page/passport/Register.vue')
    }, {
      // 找回密码
      path: 'findPwd',
      component: () => import('@/page/passport/FindPwd.vue')
    }]
  },
  {
    path: '',
    redirect: '/index'
  }, {
    // 主页
    path: '/index',
    component: () => import('@/page/Home.vue')
  }, {
    // 商品详情
    path: '/item/:id',
    component: () => import('@/page/Detail/index.vue')
  }, {
    // 商品列表
    path: '/items/:name',
    component: () => import('@/page/Items.vue')
  },
  {
    // 购物车
    path: '/cart',
    component: () => import('@/page/Cart.vue')
  }, {
    // 订单
    path: '/order',
    component: () => import('@/page/Order.vue')
  }, {
    path: '/buy',
    component: () => import('@/page/Buy.vue')

  }, {
    path: '/demo',
    component: () => import('@/page/Demo.vue')

  },
  {
    //404
    path: '/:pathMatch(.*)*',
    component: () => import('@/page/404.vue')
  }
]

export default routes
